﻿/* 
 * @autor: hectorea
 * @date: 03/08/12
 * @project: RomanNumbers
 * @reference: 
 *  http://es.wikipedia.org/wiki/Numeraci%C3%B3n_romana
 *  http://en.wikipedia.org/wiki/Roman_numerals
 *  http://www.dacostabalboa.es/wp-content/uploads/2008/05/numeros-romanos.png
 *  http://www.blackwasp.co.uk/NumberToRoman.aspx
 *  http://www.onlineconversion.com/roman_numerals_advanced.htm
 *  http://www.ehow.com/how_5060146_convert-number-roman-numerals.html
 *  http://www.ehow.com/how_8502493_convert-roman-characters-numbers.html
 *  http://www.ehow.com/how_7799048_convert-arabic-numbers.html
*/
using System;
using System.Text;

namespace RomanNumbers
{
    class Program
    {
        static void Main(string[] args)
        {

            do
            {
                Console.Clear();

                StringBuilder sb = new StringBuilder();
                sb.Append("Please type an integer to convert: ");
                Console.Write(sb.ToString());

                int number = int.Parse(Console.ReadLine());

                try
                {
                    Console.WriteLine("The Roman Number of {0:d} is {1}.", number, number.ConvertToRoman());
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }

                Console.WriteLine("Please type any key to continue testing or [X] to exit");

            } while (!Console.ReadLine().ToUpper().Equals("X"));
        }
    }
}
